<template>
  <div class="wrapper" ref="wrapper">
    <div class="content">
      <slot></slot>
    </div>  
  </div>
  <!-- <div>this.$refs.wrapper</div> -->
</template>



<script>

import BScroll from 'better-scroll'

export default {
  name:"Scroll",
  props:{
    probeType:{
      type: Number,
      default: 0
    },
    pullUpload:{
      type: Boolean,
      default: false
    }
  },
  data(){
    return{
      scroll:null,
    }
  },
  mounted () {
    
    this.scroll = new BScroll(this.$refs.wrapper,{
      observeDOM: true,
      click:true,
      probeType: this.probeType,
      pullUpLoad: this.pullUpload
      
    })

    this.scroll.on("scroll",(position)=>{
      this.$emit("scroll",position)
    })

    this.scroll.on("pullingUp",() => {
      this.$emit("pullingUp",)
    })
    
    console.log(this.scroll)    
  },
}
</script>

<style scoped>

/* .wrapper{
  height: 150px;
}

.content{
  height:200px;
  overflow:hidden;
} */

</style>